function dist_matrix=dtw_DM(data)

num_series=size(data,1);
dist_matrix=zeros(num_series);
for i=1:num_series
    for j=i+1:num_series
        dist_matrix(i,j)=DtwDistance(data(i,:),data(j,:));
    end
end

dist_matrix=dist_matrix+dist_matrix';
end